home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Ken Long / NewDisplay-c / README < prev   
Encoding:
Text File  |  1994-12-04  |  2.2 KB  |  54 lines  |  [TEXT/R*ch]

  1. Another old C source "brought back from the dead" 
  2. by Kenneth A. Long, at itty bitty bytes™!
  3.  
  4. I've posted this source before, included with other files, such as
  5. "OvalsDooDadd" which was derived from the about box of 'Display."
  6. But I must not have gotten the previous Display source to work just
  7. right, because I stated that it was "no big deal" or "nothing
  8. special."
  9.  
  10. Well, in hitting it one more time, as though I'd never seen it
  11. before, I discovered that it's actually a cool application, for a
  12. couple of reasons.
  13.  
  14. (1) It displays a 'TEXT' file in a "tty' method - not the usual way,
  15. with scroll bars, etc.  Not as a real TextEdit thing.  So, this
  16. source shows how that's done.
  17.  
  18. (2) As Greg Corson says, it can let you scan a 'TEXT' file without
  19. firing up a full blown editor or word processor, if you "just want
  20. to see what's in it" or it's layout.  Great for those "mysterious"
  21. text files you get off the net.  It's like the UNIX "cat <filename>"
  22. thing, only Macintized!  So it IS actually useful!
  23.  
  24. One thing I noticed is that if you are looking at a file and you
  25. select About Display, from the Apple Menu, the display gets an
  26. override, the About... info and graphics are displayed, then when
  27. you click it all scrolls off the top.  Doesn't "go" anywhere, but
  28. I thought that was interesting.
  29.  
  30. The reason it does that is because ALL the stuff in the display is
  31. a bitmap.  All the text is drawn by DrawChar calls, over and over.
  32. So, when it draws the About... stuf, it's just more bitmaps.  The
  33. top few rows of which are erased as it scrolls up.  Since you're
  34. reading a saved text file, it's only "drawing a picture" of the 
  35. text, rather than a TE thing.  So you couldn't "save" it, and there
  36. would be no need to.
  37.  
  38. But, you could use the "tty" display to monitor a new file that was 
  39. being created, like MacNosy does, or some ANSI programs, and "w" it
  40. to a file at the same time, as a text.  Even use toolbox calls,
  41. instead of "w".
  42.  
  43. The original built application I found crashed bigtime.  In the
  44. TC debugger, it bus errored or simply froze-all, depending on what 
  45. I had fixed so far.  The final freeze was in "Open" and some pastes
  46. from MiniEdit cured it.  I tried it, everything worked, and so, here
  47. you have it!
  48.  
  49. -Enjoy-
  50.  
  51. -Ken-
  52.  
  53. kenlong@netcom.com
  54. kenlong@aol.com